// (C) 2022 Intel Corporation. All rights reserved.
// Your use of Intel Corporation's design tools, logic functions and other 
// software and tools, and its AMPP partner logic functions, and any output 
// files from any of the foregoing (including device programming or simulation 
// files), and any associated documentation or information are expressly subject 
// to the terms and conditions of the Intel Program License Subscription 
// Agreement, Intel FPGA IP License Agreement, or other applicable 
// license agreement, including, without limitation, that your use is for the 
// sole purpose of programming logic devices manufactured by Intel and sold by 
// Intel or its authorized distributors.  Please refer to the applicable 
// agreement for further details.

(*preserve*)module A_cse_ocs_dpa_aes10c_xor4_wrapper 
 #(
    parameter OCS_AES_DPA_USE_CTECH = 0
 ) (
    input logic [3:0] x1, 
    input logic [3:0] x2, 
    input logic [3:0] x3, 
    input logic [3:0] x4, 
    input logic [3:0] o_mask,
    output logic [3:0] o
    );

    generate if (OCS_AES_DPA_USE_CTECH) begin : ct

       cse_ctech_aes_dpa_xor4 cse_ctech_aes_dpa_xor4_dcszo (.x1(x1), .x2(x2), .x3(x3), .x4(x4), .o_mask(o_mask), .o(o));

    end else begin : no_ct

       wire [3:0] p1, p2, p3;

       // Sequential mask additions (not to be optimized)
       A_cse_ocs_dpa_aes10c_xor xor0 ( .a (o_mask), .b(x4), .o(p1) );
       A_cse_ocs_dpa_aes10c_xor xor1 ( .a (p1), .b(x3), .o(p2) );
       A_cse_ocs_dpa_aes10c_xor xor2 ( .a (p2), .b(x2), .o(p3) );
       A_cse_ocs_dpa_aes10c_xor xor3 ( .a (p3), .b(x1), .o(o) );

    end
    endgenerate

endmodule
